
<%@page contentType="text/html" import="java.util.*" import="com.movie.*" pageEncoding="UTF-8"%>
<%@page import="com.movie.Movie"%>
<!DOCTYPE html>
<% List movieList = (List) request.getAttribute("resultbytitle");
   Movie movie = null;
%>
<jsp:useBean id="ListMovies" scope="session" class="com.assg2.dao.DaoMovie" />
<%@include file="header.html"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>resultBytitle</title>
    </head>
    <body>
        <h1>movie list</h1>
        <%if(movieList.size()==0){%>
            Sorry, no result found.
        <%}%>
        
        <% for(int i=0; i<movieList.size();i++)
           { movie = (Movie)movieList.get(i);
        %>
    <CENTER><table width='700px'>
            <tr>
                <td colspan='2' height='50px'>
            <CENTER><h1> <a href="dispatcher?operation=movieinfo&movieid=<%=movie.getIdmovie()%>"><%=movie.getTitle()%></a></a></h1></CENTER>
            </td>
            </tr>

            <tr>

                <td valign='top'>
            <CENTER><img width="100px" src="images/posters/<%=movie.getPoster()%>" /></CENTER>
            </td>


            <td valign='top'>
            <CENTER><table width='550px'>

                    <tr>
                        <td >
                            <b>Rating: </b><%=movie.getAgerating()%>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <b>Director: </b> <%=movie.getDirector()%>
                        </td>
                    </tr>

                    <tr>
                        <td align='justify'>
                            <b>Sypnosis: </b> <%=movie.getSynopsis()%>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <b>Avg Review: </b><% ListMovies.movierating(movie.getIdmovie());%>
                        </td>
                    </tr>

                </table></CENTER>
            </td>
            </tr>

        </table></CENTER>

    <% }%>

</body>
</html>
<%@include file="footer.html"%>